# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=ncmpc
pkgver=0.38
pkgrel=0
pkgdesc="Ncurses client for the Music Player Daemon (MPD)"
url="https://www.musicpd.org/clients/ncmpc"
arch="all"
license="GPL-2.0-or-later"
makedepends="glib-dev libmpdclient-dev meson ncurses-dev py3-sphinx boost-dev"
subpackages="$pkgname-doc $pkgname-lang $pkgname-dbg"
source="https://www.musicpd.org/download/ncmpc/0/ncmpc-$pkgver.tar.xz"

build() {
	LDFLAGS="$LDFLAGS -lintl" meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--buildtype=plain \
		-Dlirc=disabled \
		-Dcurses=ncurses \
		-Dlyrics_screen=true \
		-Dlyrics_plugin_dir=share/$pkgname/lyrics \
		. output
	ninja -C output
}

check() {
	./output/ncmpc --help > /dev/null
}

package() {
	DESTDIR="$pkgdir" ninja -C output install

	mkdir -p "$pkgdir"/usr/share/$pkgname/lyrics
	install -m755 lyrics/* \
		"$pkgdir"/usr/share/$pkgname/lyrics

	# Remove HTML documentation
	rm -rf "$pkgdir"/usr/share/doc/$pkgname/html
}

sha512sums="cdacf32f9e8bfc9a859db308b37b52e5181456ee2cb34effb7660946bb579ba992a9d9e113235f6925b22ba05d296a95bd445b6e8e7bf15c2795817df0effb98  ncmpc-0.38.tar.xz"
